package com.pruebas.xmlsimple.view;


import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.pruebas.xmlsimple.R;
import com.pruebas.xmlsimple.model.Team;

public class TeamListItemView extends LinearLayout {

	private TextView teamName;
	private TextView teamManager;
	private TextView teamPlayers;
	private TextView teamPosition;
	
	
	public TeamListItemView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}
	public TeamListItemView(Context context) {
		super(context);
		init(context);
	}
	
	private void init(Context context){
		inflate(context, R.layout.item, this);
		teamManager = (TextView) findViewById(R.id.item_team_manager);
		teamName = (TextView) findViewById(R.id.item_team_name);
		teamPlayers = (TextView) findViewById(R.id.item_team_players);
		teamPosition = (TextView) findViewById(R.id.item_team_position);
	}
	public void setTeam(Team team) {
		teamManager.setText(team.getManager());
		teamName.setText(team.getName());
		teamPlayers.setText(team.getPlayers());
		teamPosition.setText(team.getPosition());
	}
	
	

}
